package com.hundredapp.oa.repository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.hundredapp.oa.dao.GenericDao;
import com.hundredapp.oa.domain.OaAction;
import com.hundredapp.oa.domain.OaReturnVisit;

@Repository
public class ReturnVisitMangerImpl implements ReturnVisitManager {

	@Autowired
	private GenericDao<OaAction, Integer> actionDao;
	@Autowired
	private GenericDao<OaReturnVisit, Integer> returnVisitDao;
	
	public GenericDao<OaAction, Integer> getActionDao() {
		return actionDao;
	}

	public void setActionDao(GenericDao<OaAction, Integer> actionDao) {
		this.actionDao = actionDao;
	}

	public GenericDao<OaReturnVisit, Integer> getReturnvisitDao() {
		return returnVisitDao;
	}

	public void setReturnvisitDao(GenericDao<OaReturnVisit, Integer> returnvisitDao) {
		this.returnVisitDao = returnvisitDao;
	}

	@Override
	public int add(OaReturnVisit returnvisit) {
		return returnVisitDao.save(returnvisit);
	}

	@Override
	public List<OaReturnVisit> findAllReturnVisit(String condition, int start,
			int limit) {
		return returnVisitDao.find(condition, start, limit);
	}

	@Override
	public OaReturnVisit findReturnVisitById(int id) {
		return returnVisitDao.findById(id);
	}

	@Override
	public void delete(int id) {
		returnVisitDao.remove(returnVisitDao.findById(id));
	}

	@Override
	public void update(OaReturnVisit returnvisit) {
		returnVisitDao.modify(returnvisit);
	}

	@Override
	public int count(String condition) {
		return returnVisitDao.count(condition);
	}

	@Override
	public List<OaReturnVisit> findAll(String condition) {
		return returnVisitDao.find(condition);
	}

}
